﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//------//
//.............
using QLKTX1._0.DTO;
using QLKTX1._0.DB;
using System.Data.SqlClient;
using QLKTX1._0.DAO;
//...................


namespace QLKTX1._0
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

       

        private void dgv_dsTang_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            textBox1.Text = "ID100000";
        }

        private void button1_Click(object sender, EventArgs e)
        {

          
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
        }

        private void button3_Click(object sender, EventArgs e)
        {
          
        }

        private void button4_Click(object sender, EventArgs e)
        {
           
        }

        private void themToolStripMenuItem_Click(object sender, EventArgs e)
        {
         
        }
      
        private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
        {

        }

        private void dgrv2_MouseDown(object sender, MouseEventArgs e)
        {
           
        }

        private void button5_Click(object sender, EventArgs e)
        {
           
        }

        private void button6_Click(object sender, EventArgs e)
        {
          
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            int skt = textBox4.Text.Length;
            textBox2.Text = textBox1.Text.Substring(skt,textBox1.Text.Length-skt);
            textBox3.Text = Service.generateNoAuto("SinhVien", "maSoTheNoiTru", "ID", 100000);
        }
        /*
            String maSG = txtMa.Text;
            String soG = txtTen.Text;
            SoGiuongDTO sg = new SoGiuongDTO();
            sg.MaSG = maSG;
            sg.SoLuong = Int32.Parse(soG);
            SoGiuongDAO.themSoGiuong(sg);
         
         * 
         
            String maSG = textBox1.Text;
            SoGiuongDTO sg = new SoGiuongDTO();
            sg.MaSG = maSG;
            SoGiuongDAO.xoaSoGiuong(sg);
         * 
            String maSG = textBox2.Text;
            String SG = textBox3.Text;
            SoGiuongDTO sg = new SoGiuongDTO();
            sg.MaSG = maSG;

            sg.SoLuong = Int32.Parse(SG);

            if (SoGiuongDAO.capNhatSoGiuong(sg))
            {
                MessageBox.Show("Update thanh cong");
            }
         */
    }
}
